#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   统一诊断服务测试_boot_test.py
@Time    :   2025/03/20 13:31:28
@Author  :   YangLiang 
@Version :   1.0
@Contact :   yangl@genvict.com
@License :   (C)Copyright 2022-2025
@Desc    :   统一诊断服务测试BOOT
'''

from pandas._libs import interval
import pytest
import allure
import time
from pytest_assume.plugin import assume
import Set_up
from commDriver.TS_CAN import *
import math


class Test_UnifiedDiagnosticService_BOOT:
    
    @allure.severity('critical')
    @allure.title('在引导程序的默认会话中，电控单元须支持物理寻址和功能寻址的$10服务$01子功能')
    @allure.description('在引导程序的默认会话中，电控单元须支持物理寻址和功能寻址的$10服务$01子功能')
    def test_10_01_Default(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 81", "", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 81", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    @allure.title('在引导程序的编程会话中，电控单元须支持物理寻址和功能寻址的$10服务$01子功能')
    @allure.description('在引导程序的编程会话中，电控单元须支持物理寻址和功能寻址的$10服务$01子功能')
    def test_10_01_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 81", "", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 81", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    @allure.title('在引导程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$10服务$01子功能')
    @allure.description('在引导程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$10服务$01子功能')
    def test_10_01_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 81", "", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 81", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    @allure.title('在引导程序的默认会话中，电控单元须支持物理寻址和功能寻址的$10服务$01子功能')
    @allure.description('在引导程序的默认会话中，电控单元须支持物理寻址和功能寻址的$10服务$01子功能')
    def test_10_01_Default_02(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    @allure.title('在引导程序的编程会话中，电控单元须支持物理寻址和功能寻址的$10服务$02子功能')
    @allure.description('在引导程序的编程会话中，电控单元须支持物理寻址和功能寻址的$10服务$02子功能')
    def test_10_02_boot(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 82", "", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    @allure.title('在引导程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$10服务$02子功能')
    @allure.description('在引导程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$10服务$02子功能')
    def test_10_02_Extend(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDSFun')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 82", "", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    @allure.title('检查自工具发出$10 02 请求后到电控单元进入引导加载程序的时间须在1000ms内')
    @allure.description('检查自工具发出$10 02 请求后到电控单元进入引导加载程序的时间须在1000ms内')
    def test_10_02_BootTime(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 11", "67 11", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    @allure.title('检查自工具发出$10 02 请求后到电控单元进入引导加载程序的时间须在1000ms内')
    @allure.description('检查自工具发出$10 02 请求后到电控单元进入引导加载程序的时间须在1000ms内')
    def test_10_02_BootTime2(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "22 F1 97", "62 F1 97", 0, iStep, False, 'UDS')

    
    @allure.severity('critical')
    @allure.title('在引导程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$10服务$03子功能')
    @allure.description('在引导程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$10服务$03子功能')
    def test_10_03_Default(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 83", "", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 83", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    @allure.title('在引导程序的编程会话中，电控单元须支持物理寻址和功能寻址的$10服务$03子功能')
    @allure.description('在引导程序的编程会话中，电控单元须支持物理寻址和功能寻址的$10服务$03子功能')
    def test_10_03_Program(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 83", "", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDSFun')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 83", "", 0, iStep, False, 'UDSFun')


    @allure.severity('critical')
    @allure.title('发送长度不正确的诊断请求$10,电控单元须反馈否定应答代码0x12')
    @allure.description('发送长度不正确的诊断请求$10,电控单元须反馈否定应答代码0x12')
    def test_10_NRC12_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 10", "7F 10 12", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 10", "", 0, iStep, False, 'UDSFun')


    @allure.severity('critical')
    @allure.title('发送长度不正确的诊断请求$10,电控单元须反馈否定应答代码0x13')
    @allure.description('发送长度不正确的诊断请求$10,电控单元须反馈否定应答代码0x13')
    def test_10_NRC13_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "01 10 01 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 10 13"):
            assert resp[:4] == [0x03, 0x7F, 0x10, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "03 10 01 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 10 13"):
            assert resp[:4] == [0x03, 0x7F, 0x10, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "04 10 03 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 10 13"):
            assert resp[:4] == [0x03, 0x7F, 0x10, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

    @allure.severity('critical')
    def test_10_NRC22_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        # 车速大于3kph
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 8)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "7F 10 22", 0, iStep, False, 'UDS')
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 0)

    @allure.severity('critical')
    def test_10_NRC22_Extended_2(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 01 02 03", "71 01 02 03 00", 0, iStep, False, 'UDS')
        # 车速大于3kph
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 8)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "7F 10 22", 0, iStep, False, 'UDS')
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 0)

    @allure.severity('critical')
    def test_10_NRC22_Extended_3(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        # 车速大于3kph
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 8)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 01 02 03", "7F 31 22", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "7F 10 22", 0, iStep, False, 'UDS')
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 0)

    @allure.severity('critical')
    def test_boot_P3Server(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 11", "67 11", 0, iStep, False, 'UDS')
        logging.info("wait 4.5s")
        time.sleep(4.5)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 11", "67 11", 0, iStep, False, 'UDS')
        logging.info("wait 5.5s")
        time.sleep(5.5)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 11", "7F 27", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_FBL(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "02 10 02 00 00 00 00", iStep)

    
    @allure.severity('critical')
    @allure.title('在引导程序的默认会话中，电控单元须支持物理寻址和功能寻址的$11服务$01子功能')
    @allure.description('在引导程序的默认会话中，电控单元须支持物理寻址和功能寻址的$11服务$01子功能')
    def test_11_01_Defalult(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDS')
        time.sleep(1)

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 81", "", 0, iStep, False, 'UDS')
        time.sleep(1)

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDSFun')
        time.sleep(1)

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 81", "", 0, iStep, False, 'UDSFun')
        
    @allure.severity('critical')
    @allure.title('在引导程序的编程会话中，电控单元须支持物理寻址和功能寻址的$11服务$01子功能')
    @allure.description('在引导程序的编程会话中，电控单元须支持物理寻址和功能寻址的$11服务$01子功能')
    def test_11_01_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDS')
        time.sleep(1)

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 81", "", 0, iStep, False, 'UDS')
        time.sleep(1)

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDSFun')
        time.sleep(1)

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 81", "", 0, iStep, False, 'UDSFun')
        time.sleep(1)

    @allure.severity('critical')
    @allure.title('在引导程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$11服务$01子功能')
    @allure.description('在引导程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$11服务$01子功能')
    def test_11_01_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDS')
        time.sleep(1)

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 81", "", 0, iStep, False, 'UDS')
        time.sleep(1)

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDSFun')
        time.sleep(1)

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 81", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    @allure.title('电控单元在收到电控单元复位请求后，若满足复位条件，须在100ms内进行复位，且复位后进入默认会话')
    @allure.description('电控单元在收到电控单元复位请求后，若满足复位条件，须在100ms内进行复位，且复位后进入默认会话')
    def test_11_01_Time(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDS')
        time.sleep(0.1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 01", "7F 27 7F", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_11_NRC12_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 00", "7F 11 12", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 11", "7F 11 12", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_11_NRC13_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "01 11 01 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 11 13"):
            assert resp[:4] == [0x03, 0x7F, 0x11, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "03 11 01 01 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 11 13"):
            assert resp[:4] == [0x03, 0x7F, 0x11, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "04 11 01 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 11 13"):
            assert resp[:4] == [0x03, 0x7F, 0x11, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

    @allure.severity('critical')
    def test_11_NRC22_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 01 02 03", "71 01 02 03 00", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        # 车速大于3kph
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 8)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "7F 10 22", 0, iStep, False, 'UDS')
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 0)

    @allure.severity('critical')
    def test_27_01_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 1, iStep, False, 'UDS')
        time.sleep(1)
        Driver['CAN'].unlock(Driver, iStep, 1)

    @allure.severity('critical')
    def test_27_11_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        Driver['CAN'].unlock(Driver, iStep, 2)

    @allure.severity('critical')
    @allure.title('使用无效密钥进行安全访问请求的次数超出安全访问最大尝试次数，电控单元须激活安全访问延时机制，延时的时间为10s')
    @allure.description('使用无效密钥进行安全访问请求的次数超出安全访问最大尝试次数，电控单元须激活安全访问延时机制，延时的时间为10s')
    def test_2701_02_Extended_InvalidKey(self, action, Driver):
        iStep = 1
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02", 0, iStep, False)
        time.sleep(1)
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03", 1, iStep, False)
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, "27 01", "67 01", 0, iStep, False)
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, "27 02" + "11" * 16, "7F 27 35", 0, iStep, False)

        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, "27 01", "67 01", 0, iStep, False)
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, "27 02" + "11" * 16, "7F 27 35", 0, iStep, False)

        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, "27 01", "67 01", 0, iStep, False)
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, "27 02" + "11" * 16, "7F 27 36", 0, iStep, False)

        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, "27 01", "7F 27 37", 0, iStep, False)
        logging.info("等待4s")
        time.sleep(4)
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, False)
        logging.info("等待4s")
        time.sleep(4)
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, False)
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, "27 01", "7F 27 37", 0, iStep, False)
        logging.info("等待2s")
        time.sleep(3)
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, "27 01", "67 01", 0, iStep, False)
        iStep = Driver['CAN'].unlock(Driver, iStep)

    @allure.severity('critical')
    def test_27_NRC12_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 43", "7F 27 12", 0, iStep, False, 'UDS')

    # @allure.severity('critical')
    # def test_27_NRC13_Extended(self, action, Driver):
    #     iStep = 1
    #     iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')

    #     iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 0, iStep, False, 'UDS')

    #     iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "01 27 01 00 00 00 00 00", iStep)
    #     with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 27 13"):
    #         assert resp[:4] == [0x03, 0x7F, 0x27, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

    #     iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "03 27 01 01 00 00 00 00", iStep)
    #     with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 27 13"):
    #         assert resp[:4] == [0x03, 0x7F, 0x27, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

    #     iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "02 27 01 00 00 00 00 00", iStep)
    #     with allure.step(f"第{iStep}步:检查响应消息内容 # 67 01"):
    #         assert resp[1:3] == [0x67, 0x01], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")
        
    #     iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "01 27 02 00 00 00 00 00", iStep)
    #     with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 27 13"):
    #         assert resp[:4] == [0x03, 0x7F, 0x27, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")


    @allure.severity('critical')
    def test_27_NRC7E_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 11", "7F 27 7E", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_27_NRC12_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 43", "7F 27 12", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_27_NRC13_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "01 27 11 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 27 13"):
            assert resp[:4] == [0x03, 0x7F, 0x27, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "03 27 11 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 27 13"):
            assert resp[:4] == [0x03, 0x7F, 0x27, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "02 27 11 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 67 11"):
            assert resp[2:4] == [0x67, 0x11], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")
        
        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "01 27 12 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 27 13"):
            assert resp[:4] == [0x03, 0x7F, 0x27, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

    @allure.severity('critical')
    def test_27_NRC13_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "01 27 01 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 27 13"):
            assert resp[:4] == [0x03, 0x7F, 0x27, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "03 27 01 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 27 13"):
            assert resp[:4] == [0x03, 0x7F, 0x27, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "02 27 01 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 67 01"):
            assert resp[2:4] == [0x67, 0x01], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")
        
        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "01 27 02 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 27 13"):
            assert resp[:4] == [0x03, 0x7F, 0x27, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

    @allure.severity('critical')
    def test_27_NRC24_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 12" + "11" * 16, "7F 27 24", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_27_NRC24_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 02" + "11" * 16, "7F 27 24", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_27_NRC35_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 11", "67 11", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 12" + "11" * 16, "7F 27 35", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_27_NRC7E_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 01", "7F 27 7E", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_27_NRC7F_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 01", "7F 27 7F", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 11", "7F 27 7F", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_27_NRC22_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        # 车速大于3kph
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 8)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 01", "7F 27 22", 0, iStep, False, 'UDS')
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 0)

    @allure.severity('critical')
    def test_28_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 00 01", "68 00", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 80 01", "", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 00 01", "68 00", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 80 01", "", 0, iStep, False, 'UDSFun')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 01", "68 03", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 83 01", "", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 01", "68 03", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 83 01", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    @allure.title('在扩展诊断会话中，电控单元须支持物理寻址和功能寻址的$28服务$03/83子功能，通讯类型选择$01，检查电控单元能成功的使能或禁止常规报文的发送与接收')
    @allure.description('在扩展诊断会话中，电控单元须支持物理寻址和功能寻址的$28服务$03/83子功能，通讯类型选择$01，检查电控单元能成功的使能或禁止常规报文的发送与接收')
    def test_28_stopTX(self, action, Driver):
        """
        在扩展诊断会话中，电控单元须支持物理寻址和功能寻址的$28服务$03/83子功能，通讯类型选择$01，检查电控单元能成功的使能或禁止常规报文的发送与接收
        Args:
            action: 测试动作对象
            Driver: 包含CAN驱动的测试驱动对象
        """
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 1, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 01", "68 03", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}') 

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 00 01", "68 00", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 83 01", "", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')  

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 00 01", "68 00", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

        # 功能寻址
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 01", "68 03", 0, iStep, False, 'UDSFun')

        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}') 

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 00 01", "68 00", 0, iStep, False, 'UDSFun')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 83 01", "", 0, iStep, False, 'UDSFun')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')  

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 00 01", "68 00", 0, iStep, False, 'UDSFun')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

    @allure.severity('critical')
    @allure.title('在扩展诊断会话中，电控单元须支持物理寻址和功能寻址的$28服务$03/83子功能，通讯类型选择$01，检查电控单元能成功的使能或禁止常规报文的发送与接收')
    @allure.description('在扩展诊断会话中，电控单元须支持物理寻址和功能寻址的$28服务$03/83子功能，通讯类型选择$01，检查电控单元能成功的使能或禁止常规报文的发送与接收')
    def test_28_stopTX_02(self, action, Driver):
        """
        在扩展诊断会话中，电控单元须支持物理寻址和功能寻址的$28服务$03/83子功能，通讯类型选择$01，检查电控单元能成功的使能或禁止常规报文的发送与接收
        Args:
            action: 测试动作对象
            Driver: 包含CAN驱动的测试驱动对象
        """
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 F4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 1, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 03", "68 03", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}') 

    @allure.severity('critical')
    @allure.title('已禁止常规通讯报文的接收和发送时，测试使用$10 01需使能常规通讯报文的接收和发送（默认会话下，禁止使用28服务）')
    @allure.description('已禁止常规通讯报文的接收和发送时，测试使用$10 01需使能常规通讯报文的接收和发送（默认会话下，禁止使用28服务）')
    def test_28_stopTX_1001_Start(self, action, Driver):
        """
        已禁止常规通讯报文的接收和发送时，测试使用$10 01需使能常规通讯报文的接收和发送（默认会话下，禁止使用28服务）
        Args:
            action: 测试动作对象
            Driver: 包含CAN驱动的测试驱动对象
        """
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 01", "68 03", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}') 

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 83 01", "", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')  

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

        # 功能寻址
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 01", "68 03", 0, iStep, False, 'UDSFun')

        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}') 

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01", 0, iStep, False, 'UDSFun')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 83 01", "", 0, iStep, False, 'UDSFun')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')  

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01", 0, iStep, False, 'UDSFun')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

    @allure.severity('critical')
    def test_28_stopTX_1101_Start(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 01", "68 03", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}') 

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 83 01", "", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')  

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

        # 功能寻址
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 01", "68 03", 0, iStep, False, 'UDSFun')

        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}') 

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDSFun')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 83 01", "", 0, iStep, False, 'UDSFun')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')  

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDSFun')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

    @allure.severity('critical')
    def test_28_stopTX_P3Server_Start(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 F4", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 01", "68 03", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}') 
        logging.info("等待5s,P3server超时")
        time.sleep(5)
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 83 01", "", 0, iStep, False, 'UDS')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')  
        logging.info("等待5s,P3server超时")
        time.sleep(5)
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

        # 功能寻址
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 01", "68 03", 0, iStep, False, 'UDSFun')

        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}') 

        logging.info("等待5s,P3server超时")
        time.sleep(5)
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 83 01", "", 0, iStep, False, 'UDSFun')
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # 0'):
            assert TxMessageCount[0] == 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')  

        logging.info("等待5s,P3server超时")
        time.sleep(5)
        TxMessageCount, iStep = Driver['CAN'].GetTxMessageCount(Driver, iStep, 1)
        with allure.step(f'第{iStep}步:检查发送消息数量 # >0'):
            assert TxMessageCount[0] > 0, logging.error(f'发送消息数量错误, 实际发送消息数量: {TxMessageCount[0]}')

    @allure.severity('critical')
    def test_28_NRC12_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 06 01", "7F 28 12", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 0A 01", "7F 28 12", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_28_NRC13_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "02 28 00 01 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 28 13"):
            assert resp[:4] == [0x03, 0x7F, 0x28, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "04 28 00 01 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 28 13"):
            assert resp[:4] == [0x03, 0x7F, 0x28, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

    @allure.severity('critical')
    def test_28_NRC31_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 00 0A", "7F 28 31", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 05", "7F 28 31", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_28_NRC22_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        # 车速大于3kph
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 8)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 00 01", "7F 28 22", 0, iStep, False, 'UDS')
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 0)

    @allure.severity('critical')
    def test_28_NRC7F_Default(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 00 01", "7F 28 7F", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 01", "7F 28 7F", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 80 01", "7F 28 7F", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 83 01", "7F 28 7F", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 00 01", "", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 03 01", "", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 80 01", "", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "28 83 01", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    def test_85_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 01", "C5 01", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 81", "", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 02", "C5 02", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 82", "", 0, iStep, False, 'UDSFun')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 01", "C5 01", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 81", "", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 02", "C5 02", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 82", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    @allure.title('验证85服务控制DTC产生与禁止功能')
    @allure.description('验证85服务控制DTC产生与禁止功能')
    def test_85_Enable_DisEnable_Dtc_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 02", "C5 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 01", "C5 01", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 A1 43 50 09", 0, iStep, False, 'UDS')

        #抑制响应
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 82", "", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 01", "C5 01", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 A1 43 50 09", 0, iStep, False, 'UDS')

        # 功能寻址
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 02", "C5 02", 0, iStep, False, 'UDSFun')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 01", "C5 01", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 A1 43 50 09", 0, iStep, False, 'UDS')

        #抑制响应
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 82", "", 0, iStep, False, 'UDSFun')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 01", "C5 01", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 A1 43 50 09", 0, iStep, False, 'UDS')

    
    @allure.severity('critical')
    @allure.title('验证85服务控制禁止DTC功能,会话切换恢复')
    @allure.description('验证85服务控制DTC禁止功能,会话切换恢复')
    def test_85_DisEnable_Dtc_1001(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 02", "C5 02", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 A1 43 50 09", 0, iStep, False, 'UDS')

        #抑制响应
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 82", "", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 A1 43 50 09", 0, iStep, False, 'UDS')

        # 功能寻址
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 02", "C5 02", 0, iStep, False, 'UDSFun')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 A1 43 50 09", 0, iStep, False, 'UDS')

        #抑制响应
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 82", "", 0, iStep, False, 'UDSFun')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 A1 43 50 09", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    @allure.title('验证85服务控制禁止DTC功能,重启恢复')
    @allure.description('验证85服务控制DTC禁止功能,重启恢复')
    def test_85_DisEnable_Dtc_1101(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 02", "C5 02", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        # 设置电压为8v,生成低压故障
        iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDS')
        time.sleep(4)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 91 17 16 09", 0, iStep, False, 'UDS')

        #抑制响应
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 82", "", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        # 设置电压为8v,生成低压故障
        iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDS')
        time.sleep(4)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 91 17 16 09", 0, iStep, False, 'UDS')

        # 功能寻址
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 02", "C5 02", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        # 设置电压为8v,生成低压故障
        iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDS')
        time.sleep(4)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 91 17 16 09", 0, iStep, False, 'UDS')

        #抑制响应
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 82", "", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        # 设置电压为8v,生成低压故障
        iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDS')
        time.sleep(4)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 91 17 16 09", 0, iStep, False, 'UDS')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)

    @allure.severity('critical')
    @allure.title('验证85服务控制禁止DTC功能,P3Server超时恢复')
    @allure.description('验证85服务控制DTC禁止功能,P3Server超时恢复')
    def test_85_DisEnable_Dtc_P3Server(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 02", "C5 02", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        # 设置电压为8v,生成低压故障
        iStep = Driver['CAN'].SetVolt(Driver, 8.3, 3, iStep)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        logging.info("等待5s,等待P3Server超时")
        time.sleep(9)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 91 17 16 09", 0, iStep, False, 'UDS')

        #抑制响应
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 82", "", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        logging.info("等待5s,等待P3Server超时")
        time.sleep(9)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 91 17 16 09", 0, iStep, False, 'UDS')

        # 功能寻址
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 02", "C5 02", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        logging.info("等待5s,等待P3Server超时")
        time.sleep(9)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 91 17 16 09", 0, iStep, False, 'UDS')

        #抑制响应
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 82", "", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "14 FF FF FF", "54", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09", 0, iStep, False, 'UDS')
        logging.info("等待5s,等待P3Server超时")
        time.sleep(9)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "19 02 09", "59 02 09 91 17 16 09", 0, iStep, False, 'UDS')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)

    @allure.severity('critical')
    def test_85_NRC12_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 03", "7F 85 12", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 83", "7F 85 12", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_85_NRC13_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 0, iStep, False, 'UDS')

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "01 85 01 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 85 13"):
            assert resp[:4] == [0x03, 0x7F, 0x85, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "03 85 01 01 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 85 13"):
            assert resp[:4] == [0x03, 0x7F, 0x85, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

    @allure.severity('critical')
    def test_85_NRC7F_Default(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 01", "7F 85 7F", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 02", "7F 85 7F", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 01", "", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 02", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    def test_85_NRC22_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        # 车速大于3kph
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 8)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "85 01", "7F 85 22", 0, iStep, False, 'UDS')
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 0)
    
    @allure.severity('critical')
    def test_3E_Default(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 80", "", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 80", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    def test_3E_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 80", "", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 80", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    def test_3E_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 80", "", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, False, 'UDSFun')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 80", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    def test_3E_2701_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        for i in range(2):
            iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, False, 'UDS')
            time.sleep(4)
            iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 80", "", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 01", "67 01", 0, iStep, False, 'UDS')


